using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Financecycle : IAccessible<T_Financecycle, Financecycle>, ILogicEntity<T_Financecycle, Financecycle>
    {
        public int FinanceCycleID { get; set; }

        public string FinanceCycleYear { get; set; }

        public string FinanceCycleMonth { get; set; }

        public DateTime BeginDate { get; set; }

        public DateTime EndDate { get; set; }

        public int Days { get; set; }

        public int IsFinish { get; set; }

        public DateTime CarryForwardTime { get; set; }

        public string CarryForwardType { get; set; }

        public string CarryForwordUser { get; set; }

        protected override void Covariant(T_Financecycle model)
        {
            if (model != null)
            {
                    this.FinanceCycleID = model.FinanceCycleID;
                    this.FinanceCycleYear = model.FinanceCycleYear;
                    this.FinanceCycleMonth = model.FinanceCycleMonth;
                    this.BeginDate = model.BeginDate;
                    this.EndDate = model.EndDate;
                    this.Days = model.Days;
                    this.IsFinish = model.IsFinish;
                    this.CarryForwardTime = model.CarryForwardTime;
                    this.CarryForwardType = model.CarryForwardType;
                    this.CarryForwordUser = model.CarryForwordUser;
            }
}
        protected override T_Financecycle Inverter(Financecycle model)
        {
            if (model != null)
            {
                return new T_Financecycle()
                {
                    FinanceCycleID = model.FinanceCycleID,
                    FinanceCycleYear = model.FinanceCycleYear,
                    FinanceCycleMonth = model.FinanceCycleMonth,
                    BeginDate = model.BeginDate,
                    EndDate = model.EndDate,
                    Days = model.Days,
                    IsFinish = model.IsFinish,
                    CarryForwardTime = model.CarryForwardTime,
                    CarryForwardType = model.CarryForwardType,
                    CarryForwordUser = model.CarryForwordUser,
                };
            }
            return null;
        }
        public Financecycle Set(T_Financecycle dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
